<?php $this->load->view('admin/header'); ?>

<!-- DataTables js -->
<script src="<?php echo base_url('public/js/jquery.dataTables.min.js') ?>" type="text/javascript"></script>
<script src="<?php echo base_url('public/js/DT_bootstrap.js') ?>" type="text/javascript"></script>
<!-- DataTables css -->
<link href="<?pho echo base_url('public/css/DT_bootstrap.css') ?>" rel="stylesheet" type="text/css">

<script type="text/javascript">
    $(document).ready(function () {
        $('#tableMessage').dataTable({
            'bInfo': true,//显示页脚
            'bFilter': true,//搜索
            'bSort': false,//排序
            "bPaginate": true, //分页
            "bSearchable": true, //参与搜索
            'bLengthChange': true, //允许改变每页展示数量
            "bStateSave": true,//用cookies保存上一次关闭页面时的内容
            "oLanguage": {
                "sLengthMenu": "每页显示 _MENU_ 条记录",
                "sZeroRecords": "暂无数据",
                "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条",
                "sInfoEmpty": "",
                "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
                "oPaginate": {
                    "sFirst": "首页",
                    "sPrevious": "<<",
                    "sNext": ">>",
                    "sLast": "尾页"}
            },
            "sPaginationType": "bootstrap"
        });
    });
</script>
<font style="font-size: 21px">用户列表</font>
<hr>
<table class="table table-hover" id="tableMessage">
    <thead>
    <tr>
        <th>用户</th>
        <th>操作</th>
    </tr>
    </thead>
    <tfoot>
    <tr>
        <td><a class="btn btn-primary" href="<?php echo base_url("admin/changeUserView/noAdmin") ?>">新建</a></td>
    </tr>
    </tfoot>
    <tbody>
    <?php if (!empty($work)): ?>
        <?php foreach ($work as $item): ?>
            <tr>
                <td> <?php echo $item['userName'] ?></td>
                <td>
                    <a href="<?php echo base_url("admin/changeUserView/update/".$item['id']) ?>">修改</a>
                    | <a href="<?php echo base_url("admin/deleteMessage/".$item['id']) ?>">删除</a>
                </td>
            </tr>
        <?php endforeach ?>
    <?php endif ?>
    </tbody>
</table>

<?php $this->load->view('admin/footer'); ?>
